Skip to content

feat(diversity): per-platform Layer-A state, exhaustion warnings, gro… - #7

Open
PlevanTem wants to merge 1 commit into
mainfrom
feat/diversity-persistence-corpus-expansion
Open

feat(diversity): per-platform Layer-A state, exhaustion warnings, gro…#7
PlevanTem wants to merge 1 commit into
mainfrom
feat/diversity-persistence-corpus-expansion

Conversation

@PlevanTem

Copy link
Copy Markdown
Owner

…w-corpus.js

Three coordinated changes to make the corpus-direct diversity system persistent and infinitely extensible across batches:

  1. Per-platform Layer-A usage state (run-corpus.js)

    • Default path now corpus_usage_{platform}.json (was corpus_usage.json)
    • Platform is resolved before usageStatePath so mobile and web never write into each other's state; aligns with the per-platform files already written by merge-subagent-retry.js
  2. Exhaustion warnings (query_factory_v2.js)

    • pickLeastUsedTopics() emits [Layer-A WARN] with l2Key when count > pool_size (cycling is about to start)
    • buildCorpusPlan() emits a pre-call warning when all topics in an L2 have been used at least once
  3. grow-corpus.js — new script for LLM-based topic pool expansion

    • Scans corpus_data[_web].json for L2s with <threshold fresh topics
    • Generates expand-by new topics via Claude CLI per L2
    • Jaccard dedup (threshold 0.4) prevents near-duplicate additions
    • Appends in-place to corpus file; dry-run mode available
    • Usage: node scripts/grow-corpus.js [--platform mobile|web] [--threshold 10] [--expand-by 20] [--dry-run]
  4. README: three new sections (No-API mode, grow-corpus.js, merge-subagent-retry.js) + extended parameter table for run-corpus.js (--platform, --prep-only, --prep-batch, --score, --no-xlsx)

  5. docs/index.html: Layer-A cards + i18n strings updated to reference per-platform state files and grow-corpus.js; both en/zh blobs synced

…w-corpus.js

Three coordinated changes to make the corpus-direct diversity system
persistent and infinitely extensible across batches:

1. Per-platform Layer-A usage state (run-corpus.js)
   - Default path now corpus_usage_{platform}.json (was corpus_usage.json)
   - Platform is resolved before usageStatePath so mobile and web
     never write into each other's state; aligns with the per-platform
     files already written by merge-subagent-retry.js

2. Exhaustion warnings (query_factory_v2.js)
   - pickLeastUsedTopics() emits [Layer-A WARN] with l2Key when
     count > pool_size (cycling is about to start)
   - buildCorpusPlan() emits a pre-call warning when all topics in
     an L2 have been used at least once

3. grow-corpus.js — new script for LLM-based topic pool expansion
   - Scans corpus_data[_web].json for L2s with <threshold fresh topics
   - Generates expand-by new topics via Claude CLI per L2
   - Jaccard dedup (threshold 0.4) prevents near-duplicate additions
   - Appends in-place to corpus file; dry-run mode available
   - Usage: node scripts/grow-corpus.js [--platform mobile|web]
            [--threshold 10] [--expand-by 20] [--dry-run]

4. README: three new sections (No-API mode, grow-corpus.js,
   merge-subagent-retry.js) + extended parameter table for run-corpus.js
   (--platform, --prep-only, --prep-batch, --score, --no-xlsx)

5. docs/index.html: Layer-A cards + i18n strings updated to reference
   per-platform state files and grow-corpus.js; both en/zh blobs synced

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant